#pragma once

#include <d3d10.h>
#include "EnginePointer.h"
#include "VertexTypes.h"
#include "DirectionalLightComponent.h"
#include "ICameraComponent.h"

class DirectionalLightRenderer
{
public:
	DirectionalLightRenderer(void);
	~DirectionalLightRenderer(void);

	HRESULT LoadGraphicsContent(EnginePointer<ID3D10Device>& pDevice, EnginePointer<ID3D10EffectPool>& pCommonPool);
    void UnloadGraphicsContent();
	HRESULT Render(list<EnginePointer<DirectionalLightComponent>>::iterator lightsBegin, list<EnginePointer<DirectionalLightComponent>>::iterator lightsEnd);
private:
	EnginePointer<ID3D10Device> pDevice;
	ID3D10Effect* pEffect;
	ID3D10InputLayout* pVertexLayout;
	ID3D10EffectTechnique* pTechnique;
	ID3D10EffectVectorVariable* pDirectionVariable;
	ID3D10EffectVectorVariable* pColorVariable;
	ID3D10EffectScalarVariable* pIntensityVariable;
	ID3D10Buffer* pVertexBuffer;
	ID3D10Buffer* pIndexBuffer;

	HMODULE contentModule;

	static PositionTexVertex vertices[4];
	static DWORD indices[6];
};
